package com.fr.report.core.gif;

import java.util.Enumeration;
import java.util.NoSuchElementException;

class IntHashtableEnumerator
  implements Enumeration
{
  boolean keys;
  int index;
  IntHashtableEntry[] table;
  IntHashtableEntry entry;

  IntHashtableEnumerator(IntHashtableEntry[] paramArrayOfIntHashtableEntry, boolean paramBoolean)
  {
    this.table = paramArrayOfIntHashtableEntry;
    this.keys = paramBoolean;
    this.index = paramArrayOfIntHashtableEntry.length;
  }

  public boolean hasMoreElements()
  {
    if (this.entry != null)
      return true;
    do
      if (this.index-- <= 0)
        break label42;
    while ((this.entry = this.table[this.index]) == null);
    return true;
    label42: return false;
  }

  public Object nextElement()
  {
    if (this.entry == null)
      while (this.index-- > 0)
        if ((this.entry = this.table[this.index]) != null)
          break;
    if (this.entry != null)
    {
      IntHashtableEntry localIntHashtableEntry = this.entry;
      this.entry = localIntHashtableEntry.next;
      return ((this.keys) ? new Integer(localIntHashtableEntry.key) : localIntHashtableEntry.value);
    }
    throw new NoSuchElementException("IntHashtableEnumerator");
  }
}